package com.ler.yrmall.coupon.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ler.yrmall.basic.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * @author Leron
 */
@Data
@TableName("sms_coupon_history")
@EqualsAndHashCode(callSuper = true)
public class CouponHistoryEntity extends BaseEntity<CouponHistoryEntity> {

    /**
     * 优惠券
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long couponId;

    /**
     * 会员
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long memberId;

    /**
     * 会员名称
     */
    private String memberUsername;

    /**
     * 领取类型
     * @see CouponEntity.ReceiveType
     */
    private Integer receiveType;

    /**
     * 是否使用
     */
    private Integer used;

    /**
     * 使用时间
     */
    private LocalDateTime useTime;

    /**
     * 订单号
     */
    private String orderSn;

}
